using UnityEngine;

public class DirectionControl : MonoBehaviour
{
	public static Vector3 direction;

	public static bool key1Down;

	public static bool key1Pressed;

	public static bool key1Up;

	protected bool down;

	protected bool prevDown;

	public Vector3 desiredDirection;

	public bool isKey1;

	private void Awake()
	{
		direction = Vector3.zero;
	}

	private void OnPress(bool down)
	{
		this.down = down;
	}

	private void Update()
	{
		if (down)
		{
			direction += desiredDirection;
		}
		if (isKey1)
		{
			if (down != prevDown)
			{
				key1Down = down;
				key1Up = !down;
			}
			key1Pressed = down;
		}
		prevDown = down;
	}

	private void LateUpdate()
	{
		direction = Vector3.zero;
		key1Down = (key1Up = (key1Pressed = false));
	}
}
